using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;

namespace Penult.BNet.Halo3.PlayedGames
{
    public class Team : Entity
    {
        #region Class Variables
        private List<Player> _players = new List<Player>();
        private Color _primaryColor = Color.Empty;
        #endregion

        public override int Assists
        {
            get
            {
                int assists = 0;

                foreach (Player p in Players)
                {
                    assists += p.Assists;
                }

                return assists;
            }
        }
        public override int Betrayals
        {
            get
            {
                int betrayals = 0;

                foreach (Player p in Players)
                {
                    betrayals += p.Betrayals;
                }

                return betrayals;
            }
        }
        public override int Deaths
        {
            get
            {
                int deaths = 0;

                foreach (Player p in Players)
                {
                    deaths += p.Deaths;
                }

                return deaths;
            }
        }
        public override int Kills
        {
            get
            {
                int kills = 0;

                foreach (Player p in Players)
                {
                    kills += p.Kills;
                }

                return kills;
            }
        }
        public List<Player> Players 
        {
            get { return _players; }
            set { _players = value; }
        }
        public Color PrimaryColor 
        {
            get { return _primaryColor; }
            set { _primaryColor = value; }
        }
        public override int Score
        {
            get
            {
                int scores = 0;

                foreach (Player p in Players)
                {
                    scores += p.Score;
                }

                return scores;
            }
        }
        public override int Suicides
        {
            get
            {
                int suicides = 0;

                foreach (Player p in Players)
                {
                    suicides += p.Suicides;
                }

                return suicides;
            }
        }

        public Team() : base()
        {
            PrimaryColor = Color.Empty;
            Players = new List<Player>();
        }
    }
}
